//
//  FansManagerViewController.m
//  快圈
//
//  Created by 宁宁 on 16/9/12.
//  Copyright © 2016年 ym. All rights reserved.
//

#import "FansManagerViewController.h"

#import "FansInfomationTableViewCell.h"//cell

@interface FansManagerViewController () <UITableViewDelegate, UITableViewDataSource>

@property (nonatomic, strong) UITableView *tableView;

@end

@implementation FansManagerViewController
{
    UITextField *_search;
}

 static NSString *const FansInfomationTableViewCellID = @"FansInfomationTableViewCell";

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.view.backgroundColor = RGBACOLOR(36, 34, 47, 1);
    
    [self setNav];
    
    [self setSearchView];
    
    [self registerTableView];
}

- (void)setNav{
    self.title = @"粉丝管理";
    UIBarButtonItem *back = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"back"] style:UIBarButtonItemStylePlain target:self action:@selector(back)];
    self.navigationItem.leftBarButtonItem = back;
}

- (void)setSearchView{
    UIView *searchView = [[UIView alloc] initWithFrame:CGRectMake(15, 15, SCREEN_WIDTH - 30, 25)];
    searchView.layer.cornerRadius = 5;
    searchView.layer.masksToBounds = YES;
    searchView.backgroundColor = [UIColor whiteColor];
    [self.view addSubview:searchView];
    
    _search = [[UITextField alloc] initWithFrame:CGRectMake(10, 0, SCREEN_WIDTH - 50, 25)];
    _search.placeholder = @"请输入姓名、手机号、编号";
    _search.textColor = RGBACOLOR(146, 146, 146, 1);
    _search.font = [UIFont boldSystemFontOfSize:12];
    [searchView addSubview:_search];
}

- (void)registerTableView{
    [self.tableView registerNib:[UINib nibWithNibName:@"FansInfomationTableViewCell" bundle:nil] forCellReuseIdentifier:FansInfomationTableViewCellID];
}

#pragma mark === TableViewDelegate ===
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 10;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return 147;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    FansInfomationTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:FansInfomationTableViewCellID];
//    cell.Id.text =
//    cell.name.text =
//    cell.weixin.text =
//    cell.registerDate.text =
//    cell.buyNum.text =
//    cell.todayNum.text =
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    return cell;
}

- (void)back{
    [self.navigationController popViewControllerAnimated:YES];
}

- (UITableView *)tableView{
    if (!_tableView) {
        _tableView= [[UITableView alloc]initWithFrame:CGRectMake(0,50, SCREEN_WIDTH, SCREEN_HEIGHT - 50 - 64)style:UITableViewStylePlain];
        _tableView.delegate = self;
        _tableView.dataSource = self;
        _tableView.separatorColor = [UIColor clearColor];
        _tableView.backgroundColor = RGBACOLOR(36, 34, 47, 1);
        _tableView.showsVerticalScrollIndicator = NO;//去掉滑动竖条
        [self.view addSubview:_tableView];
    }
    return _tableView;
}

@end
